package digui;

public class Sum {
    public static void main(String[] args) {
        int i = swapSum(100);
        System.out.println(i);
        double v = swapSum1(2);
        System.out.println(v);
    }
    public static int swapSum(int n){
        if(n==0){
            return n;
        }else {
            return n+swapSum(n-1);
        }
    }
    public static double swapSum1(int n){
        if(n==0){
            return n;
        }else {
            return 1.0/n+swapSum(n-1);
        }
    }
}
